package com.zito.health.controller;

import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.PlatformResult;
import com.zito.health.common.result.VerifyResult;
import com.zito.health.entity.ItemCooperation;
import com.zito.health.entity.ItemResearcher;
import com.zito.health.service.ItemCooperationService;
import com.zito.health.service.ItemResearcherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目研究人员
 */
@Slf4j
@RestController
@RequestMapping("/item/cooperation")
public class ItemCooperationController {

    @Autowired
    private ItemCooperationService itemCooperationService;

    @PostMapping("/save")
    public PlatformResult save(ItemCooperation item){
        itemCooperationService.save(item);
        return  PlatformResult.success();
    }

    @PostMapping("/update")
    public PlatformResult update(ItemCooperation item){
        itemCooperationService.update(item);
        return  PlatformResult.success();
    }

    @PostMapping("/list")
    public PlatformResult list(ItemCooperation item){
        return PlatformResult.success(itemCooperationService.query(item));
    }

    @PostMapping("/delete")
    public PlatformResult delete(Integer id){
        itemCooperationService.delete(id);
        return  PlatformResult.success();
    }

    @PostMapping("/query")
    public PlatformResult query(ItemCooperation item){
        return PlatformResult.success(itemCooperationService.queryOne(item));
    }
}
